package com.blast.comicsisland.model.game.gamebody;

import com.blast.comicsisland.model.game.DownloadUrls;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by dell on 2015/6/24.
 */
public class Info {
    private String size;
    private int id;
    private String promotionimage;
    private String apptype;
    private String downloadnum;
    private String packagename;
    private String imageurl;
    private String discussnum;
    private String promotiontype;
    private DownloadUrls downloadurls;
    private String name;
    private String description;

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPromotionimage() {
        return promotionimage;
    }

    public void setPromotionimage(String promotionimage) {
        this.promotionimage = promotionimage;
    }

    public String getApptype() {
        return apptype;
    }

    public void setApptype(String apptype) {
        this.apptype = apptype;
    }

    public String getDownloadnum() {
        return downloadnum;
    }

    public void setDownloadnum(String downloadnum) {
        this.downloadnum = downloadnum;
    }

    public String getPackagename() {
        return packagename;
    }

    public void setPackagename(String packagename) {
        this.packagename = packagename;
    }

    public String getImageurl() {
        return imageurl;
    }

    public void setImageurl(String imageurl) {
        this.imageurl = imageurl;
    }

    public String getDiscussnum() {
        return discussnum;
    }

    public void setDiscussnum(String discussnum) {
        this.discussnum = discussnum;
    }

    public String getPromotiontype() {
        return promotiontype;
    }

    public void setPromotiontype(String promotiontype) {
        this.promotiontype = promotiontype;
    }

    public DownloadUrls getDownloadurls() {
        return downloadurls;
    }

    public void setDownloadurls(DownloadUrls downloadurls) {
        this.downloadurls = downloadurls;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    //---------------------------------------->
    //解析
    /*

        "size": "124.00",
        "id": 124,
        "promotionimage": "http://mhd.1391.com/book/gamecenter/720X350.jpg", "apptype": 1,
        "downloadnum": 0,
        "packagename": "com.muka.shipwar",
        "imageurl": "http://mhd.1391.com/book/gamecenter/150.png",
        "discussnum": 6,
        "promotiontype": 0,
        "downloadurls": {
        "android": "https://dn-zhuishu-download.qbox.me/ ZJSN_MHD_P7game_1.3.3_1321_channel18.apk"
        },
        "name": "战舰少⼥女",
        "description": "漫画岛游戏玩家QQ群:466194573~~O(∩_∩)O~~\r\n《战舰少⼥女》是⼀一款⾮非
        常萌⽓气的策略养成卡牌游戏,玩家们将与众多妹⼦子们⼀一起展开海上争霸的旅程。游戏将所有的战舰 都拟⼈人化,将它们变成美丽动⼈人的妹⼦子,这让我等屌丝单⾝身男如何是好啊。游戏的战⽃斗过程并没有 过于激烈刺激,完全是在⻘青春懵懂的战⽃斗中结束的,很考验⼤大家在战⽃斗前的细致准备,各位有兴趣 的就赶紧来试试吧。\r\n 游戏采⽤用了卡牌系列的战⽃斗⽅方式,玩家们在战⽃斗之前可以对⾃自⼰己的队伍 进⾏行排列和编队,⽽而到了真正的战场上,则完全不需要⼤大家操作,全部将由系统⾃自动完成对战,以 回合制的⽅方式进⾏行战⽃斗。游戏的战⽃斗过程看起来并不激烈,反⽽而有种⼩小清新的格调,相⽐比很多射击 游戏或者RPG对战型,真的少了视觉上的热⾎血期待,完全是以智慧来⽐比拼。"
        },
     */
    public void jsonParse(JSONObject jsonObject) {
        if (jsonObject != null) {
            try {
                size = jsonObject.getString("size");
                id = jsonObject.getInt("id");
                promotionimage = jsonObject.getString("promotionimage");
                imageurl = jsonObject.getString("imageurl");
                name = jsonObject.getString("name");
                description = jsonObject.getString("description");
                JSONObject downloadurlsObj = jsonObject.getJSONObject("downloadurls");
                downloadurls = new DownloadUrls();
                downloadurls.jsonParse(downloadurlsObj);
            } catch (JSONException e) {
                e.printStackTrace();
            }


        }
    }


}
